layui.use(['element', 'form'], function() {
    var element = layui.element;
    var form = layui.form;

    // 初始化 Tab 组件
    element.init();
});

var param={
    userid:undefined,
    status:undefined,
    curr:1,
    size:5
}

window.onload = function (){
    findOrder();
}
// $(function (){
//     findOrder()
// })
function findOrder(){
    $.ajax({
        url:'order/select',
        type:'Get',
        data:param,
        dataType:'JSON',
        success(res){
           console.log(res);
           showTable(res.data.orderList)
           pageTotal =Math.ceil(res.data.total/param.size);
           showPage(pageTotal)
        }
    })
}

function  goPage(num){
    if(page.curr+num<1 || page.curr+num >pageTotal){
        alert("没了")
        return;
    }
    param.curr += num;
    findOrder()
}

function showPage(total){
    $("#page").html(`${param.curr} / ${total}`)
}

function showTable(arr){

}

